<template>
  <div>
    <inputBox :formSearchData="formSearchData" :form_item="form_item" />
    <div class="dataList out-border d-flex justify-content-between layout-top">
      <div class="screen-l">
        <i class="el-icon-tickets"></i>
        <span class="txt">数据列表</span>
      </div>
      <el-button size="mini" @click="() => this.$router.push('/pms/addProduct')">添加</el-button>
    </div>
    <div class="layout-top">
      <tableData :config="table_config" />
    </div>
  </div>
</template>
<script>
import inputBox from '@/components/common/input_template/index.vue'
import tableData from '@/components/common/table_template/index.vue'
import { mkfsTime, handlerStatus } from '@/utils/utils'
export default {
  name: 'ReturnApplyCom',
  data() {
    return {
      // 表格配置
      table_config: {
        thead: [
          {
            label: '服务单号',
            prop: 'id',
          },
          {
            label: '申请时间',
            prop: 'createTime',
            type: 'function',
            callback: (row) => {
              return mkfsTime(row.createTime)
            },
          },
          {
            label: '用户账号',
            prop: 'memberUsername',
          },
          {
            label: '退款金额',
            prop: 'productRealPrice',
            type: 'function',
            callback: (row) => {
              return `￥${row.productRealPrice}`
            },
          },
          {
            label: '申请状态',
            prop: 'status',
            type: 'function',
            callback: (row) => {
              return handlerStatus.putIn_status[row.status].status
            },
          },
          {
            label: '处理时间',
            prop: 'handleTime',
            type: 'function',
            callback: (row) => {
              return row.handleTime ? mkfsTime(row.handleTime) : 'N/A'
            },
          },
          {
            label: '操作',
            type: 'operation',
            default: {
              deleteBtn: false,
              detailsBtn: {
                status: true,
                path: '/oms/returnApplyDetail',
              },
            },
          },
        ],
        url: 'returnApply/list',
        format: 'list',
        paging: true,
        batchhandler: true,
      },
      // 表单每一项
      form_item: [
        {
          type: 'Input',
          label_name: '输入搜索',
          placeholder: '订单编号',
          prop: 'orderSn',
        },
        {
          type: 'Select',
          label_name: '处理状态',
          placeholder: '收货人姓名/手机号码',
          prop: 'receiverKeyword',
        },
        {
          label_name: '申请时间:',
          placeholder: '请选择日期',
          type: 'Date',
        },
        {
          label_name: '操作人员',
          placeholder: '全部',
          type: 'Input',
        },
        {
          label_name: '处理时间',
          placeholder: '全部',
          type: 'Date',
        },
      ],
      formSearchData: {
        //输入搜索
        orderSn: '',
        // 收货人
        receiverKeyword: '',
        //提交时间
        createTime: '',
        //订单状态
        status: '',
        //订单分类
        orderType: '',
        // 订单来源
        sourceType: '',
      },
    }
  },
  methods: {},
  components: {
    inputBox,
    tableData,
  },
}
</script>
<style lang="scss" scoped>
.dataList {
  padding: 18px 20px;
}
</style>
